class AcountActivationsController < ApplicationController


	def edit
		user =User.find_by(email: params[:email])
		if user&& !user.activated? &&user.authenticated?(:activation,params[:id])
			update_attribute(:activated,true)
			update_attribute(:activated_at,Time.zone.now)
			log_in user
			flash[:success]='激活成功'
			redirect_to user

		else
			redirect_to root_url
			
		end

	end

end
